<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box {
      width: 400px;
      height: 200px;
      background-color: red;
    }
  </style>
</head>

<body>
  <div class="box"></div>
  <script>
    const box = document.querySelector('.box');
    box.addEventListener('click', function () {
      // console.log('点击了红色盒子')
    })
    box.addEventListener('dblclick', function () {
      console.log('双击了红色盒子')
    })
    box.addEventListener('mouseenter', function (e) {
      console.log('鼠标进入了红色盒子')
    })
    box.addEventListener('mouseleave', function (e) {
      console.log('鼠标离开了红色盒子')
    })
    box.addEventListener('mousemove', function (e) {
      console.log('鼠标在盒子上移动')
    })

  </script>
</body>

</html>